 package sprg;
 
 import java.io.PrintWriter;
 import javax.servlet.http.HttpServletResponse;
 
 public abstract class jpage
 {
   public conf conf;
   public String eMessage;
   public Long pageStartTimeMillis;
   public Long pageEndTimeMillis;
   public Long pageRunTimeMillis;
 
   public void PageAutoRedirect()
   {
     String str1 = this.conf.getNURLPre();
     String str2 = cls.getLRStr(str1, "/", "right");
     Integer localInteger = cls.getNum(this.conf.jt.itake("global.config.autoredirect", "cfg"), Integer.valueOf(0));
     if ((localInteger.intValue() != 1) || 
       (cls.isEmpty(str2).booleanValue()))
       return;
     str2 = str2.toLowerCase();
     if (cls.getLRStr(str2, ".", "left") == "www")
       return;
     String str3 = "www." + str2;
     str1 = str1.toLowerCase();
     str1 = str1.replace(str2, str3);
     String str4 = str1 + this.conf.getNURI();
     if (cls.getLRStr(str4, "/", "right").equals("default.jsp")) str4 = cls.getLRStr(str4, "/", "leftr") + "/";
     if (!(cls.isEmpty(this.conf.getNURS()).booleanValue())) str4 = str4 + "?" + this.conf.getNURS();
     this.conf.response.setStatus(301);
     this.conf.response.setHeader("Location", str4);
   }
 
   public void Init(Object paramObject1, Object paramObject2)
   {
     Object localObject1 = paramObject1;
     Object localObject2 = paramObject2;
     this.conf = new conf();
     this.conf.Init(localObject1, localObject2);
   }
 
   public void PageInit()
   {
     PageAutoRedirect();
     this.pageStartTimeMillis = Long.valueOf(System.currentTimeMillis());
     this.conf.ntitle = this.conf.jt.itake("global.default.web_title", "lng");
     this.conf.navSpStr = this.conf.jt.itake("global.config.navspstr", "cfg");
     this.conf.ntitleSpStr = this.conf.jt.itake("global.config.ntitlespstr", "cfg");
   }
 
   public void PageNoCache()
   {
     this.conf.response.setDateHeader("Expires", 0L);
     this.conf.response.setHeader("Cache-Control", "no-cache");
   }
   
   public void PagePrint(String paramString){
	   String str = paramString;
	   PagePrint(str,Boolean.valueOf(true));
   }
   
   public void PagePrint(String paramString,Boolean paramBoolean)
   {
     Boolean localBoolean = paramBoolean;
     String str = paramString;
     if (!(cls.isEmpty(str).booleanValue()))
     {
       if (str.length() < this.conf.ajaxPreContent.length()) localBoolean = Boolean.valueOf(false);
       else if (str.substring(0, this.conf.ajaxPreContent.length()).equals(this.conf.ajaxPreContent)) localBoolean = Boolean.valueOf(false);
     }
 
     if (localBoolean.booleanValue())
     {
       this.pageEndTimeMillis = Long.valueOf(System.currentTimeMillis());
       this.pageRunTimeMillis = Long.valueOf(this.pageEndTimeMillis.longValue() - this.pageStartTimeMillis.longValue());
       str = str + "\r\n<!--SPRG Processed in " + this.pageRunTimeMillis + " ms-->";
     }
     try
     {
       PrintWriter localPrintWriter = this.conf.response.getWriter();
       localPrintWriter.print(str);
       localPrintWriter.close();
     }
     catch (Exception localException) {
     }
   }
 
   public void PageClose() {
     this.pageEndTimeMillis = Long.valueOf(System.currentTimeMillis());
     this.pageRunTimeMillis = Long.valueOf(this.pageEndTimeMillis.longValue() - this.pageStartTimeMillis.longValue());
   }
 }